using System;
using System.Web.UI.WebControls;
using ConcursoCV.UI.Clases.ManejadoresControles;
using Pluspetrol.Core.UIControls.WebControls;

namespace ConcursoCV.UI.Clases.ManejadoresControles
{
	/// <summary>
	/// Summary description for ManejadorCalendar.
	/// </summary>
	public class ManejadorCDatePicker : ManejadorControles
	{
		public ManejadorCDatePicker()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		public override void Cargar(WebControl ctrl, object value)
		{
			if (value != null)
			{
				((CDatePicker)ctrl).Text = (DateTime.Parse(value.ToString())).ToString("d",Helper.GlobalizationHelper.GetCurrentCultureInfoFormatProvider());
			}
		}
		public override void Inicializar(WebControl ctrl, object value)
		{
			//((CDatePicker)ctrl).Format =  DateTimePickerFormat.Custom;
		}
		public override string GetValor(WebControl ctrl)
		{
			return ((CDatePicker)ctrl).Text;
		}
	}
}
